clear all;
load bai31;
SNR_db=0:2:8;
for i=1:length(SNR_db)
    c(i)=cha(SNR_db(i),S,x);
end
BEP=c/length(x);
semilogy(SNR_db,BEP,'.--')
title('ham xac suat loi bit')
xlabel('SNR in dB')
ylabel('P_b')
legend('P_b')
save bai41 c BEP
